﻿<%@ Page Language="C#" MasterPageFile="~/MasterPageLayout.master" AutoEventWireup="true" CodeBehind="frmGroupUser.aspx.cs" Inherits="BVVD_Website.userRight.frmGroupUser" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        div.RadListBox .rlbGroup {
            overflow: auto;
        }

        .rsbHeader ul,
        .rsbListItem ul {
            margin: 0;
            padding: 0;
            width: 100%;
            display: inline-block;
            list-style-type: none;
        }

        .rsbHeader ul {
            padding-left: 5px;
        }

        .col1,
        .col2,
        .col3 {
            margin: 0;
            padding: 0 5px 0 0;
            width: 110px;
            line-height: 14px;
            float: left;
        }


        html .rsbSlide,
        html .rsbDropDownSlide {
            z-index: 90002;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="server">
    
    <div id="Div1" class="mpBottomContent" runat="server">
        <asp:Label runat="server" ID="lblMenu" Style="margin: 0 auto 0 auto; font-family: 'Microsoft Sans Serif'; font-size: larger; color: forestgreen" Text="GÁN NGƯỜI SỬ DỤNG VÀO NHÓM"></asp:Label>

        <table style="margin: 0 auto 0 auto; border: 5px thin red; width: 90% !important; padding: 5px 5px 5px 5px">
            <caption style="float: left">
                <telerik:RadDropDownList DefaultMessage="Chọn nhóm" DropDownHeight="200" Skin="Hay"  OnSelectedIndexChanged="ddlGROUP_SelectedIndexChanged" AutoPostBack="true" runat="server" ID="ddlGROUP">

                </telerik:RadDropDownList>
            </caption>
            <tr>
                <td>
                    <telerik:RadGrid ID="grvGroupUser" Skin="Hay" AllowFilteringByColumn="true" MasterTableView-NoMasterRecordsText="Không tìm thấy bản ghi nào" MasterTableView-ShowHeadersWhenNoRecords="true" ClientSettings-ColumnsReorderMethod="Reorder" ClientSettings-AllowColumnsReorder="true" ClientSettings-Animation-AllowColumnReorderAnimation="true" ClientSettings-Animation-ColumnReorderAnimationDuration="300" PageSize="15" AllowSorting="true"  AutoGenerateColumns="false" AllowPaging="true" ClientSettings-AllowDragToGroup="true" runat="server" OnNeedDataSource="grvGroupUser_NeedDataSource"  OnItemDataBound="grvGroupUser_ItemDataBound" OnUpdateCommand="grvGroupUser_UpdateCommand" >

                        <PagerStyle Mode="NextPrevAndNumeric" PageSizeControlType="RadComboBox" Wrap="true" AlwaysVisible="true" />

                        <MasterTableView CommandItemDisplay="Top" EnableNoRecordsTemplate="true" CssClass="MasterClass" ShowFooter="true" EditMode="PopUp" Summary="SUMMARY" ShowHeadersWhenNoRecords="true"
                            DataKeyNames="MANSD">
                            <CommandItemSettings ShowAddNewRecordButton="false" AddNewRecordText="Thêm mới" RefreshText="Làm mới danh sách" ExportToPdfText="Xuất file dạng PDF" ShowExportToPdfButton="true"></CommandItemSettings>
                            <CommandItemSettings ExportToExcelText="XUất file dạng Excel" ShowExportToExcelButton="true"></CommandItemSettings>

                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

                            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column" Created="True"></ExpandCollapseColumn>
                            <NoRecordsTemplate>
                                <div>
                                    Không có bản ghi nào
                                </div>
                            </NoRecordsTemplate>
                            <Columns>

                                <telerik:GridBoundColumn UniqueName="RECID" EditFormColumnIndex="1" Display="false" ReadOnly="true" HeaderText="" DataField="RECID">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                    <HeaderStyle ForeColor="Silver" Width="20px"></HeaderStyle>
                                    <ItemStyle ForeColor="Gray"></ItemStyle>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="MANSD" ItemStyle-HorizontalAlign="Left" Display="false" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Mã người sử dụng" DataField="MANSD">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="TENNSD" ItemStyle-HorizontalAlign="Left" Display="true" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Tên người sử dụng" DataField="TENNSD">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="MANHOM" ItemStyle-HorizontalAlign="Left" Display="false" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Mã nhóm" DataField="MANHOM">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="TENNHOM"  ItemStyle-HorizontalAlign="Left" Display="true" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Tên nhóm" DataField="TENNHOM">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="NGAYGAN" DataFormatString="{0:dd/MM/yyyy}" ItemStyle-HorizontalAlign="Left" Display="true" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Ngày gán" DataField="NGAYGAN">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="TRANGTHAI" ItemStyle-HorizontalAlign="Left" Display="false" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Trạng thái" DataField="TRANGTHAI">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>
                                
                                <telerik:GridBoundColumn UniqueName="GHICHU" ItemStyle-HorizontalAlign="Left" FilterControlWidth="70%" Display="false" HeaderStyle-Width="30%" HeaderText="Ghi chú" DataField="GHICHU">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>                                
                            </Columns>
                            
                            <EditFormSettings EditFormType="Template" PopUpSettings-ShowCaptionInEditForm="true" InsertCaption="Gán mới người sử dụng - nhóm" PopUpSettings-ZIndex="4000" PopUpSettings-Modal="true" CaptionFormatString="Mã người sử dụng {0}" CaptionDataField="MANSD">
                                    <FormTemplate>
                                        <div id="rfd-demo-zone" style="overflow: auto; border: solid; border-color: whitesmoke; border-width: 5px; padding: 6px 6px 6px 6px;">
                                            <table width="350" border="0" style="text-align: left" cellspacing="8" cellpadding="8">
                                                <caption style="color: green; font-weight: bold">
                                                    THÔNG TIN NHÓM - NGƯỜI SỬ DỤNG
                                                </caption>
                                                <tr>
                                                    <td></td>
                                                    <td></td>
                                                </tr>
                                                <tr>
                                                    <td>Mã người dùng</td>
                                                    <td>
                                                        <asp:Label runat="server" Style="color: green; font-weight: bold" Text='<%# Bind("MANSD")  %>' ID="lblMANSD" ></asp:Label>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>Tên người sử dụng</td>
                                                    <td>
                                                        <asp:Label runat="server" Style="color: green; font-weight: bold" Text='<%# Bind("TENNSD")  %>' ID="lblTENNSD" ></asp:Label>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>Tên nhóm</td>
                                                    <td>
                                                        <telerik:RadDropDownList DropDownHeight="200" Skin="Telerik"  runat="server" DefaultMessage="Chọn" ID="ddlMANHOM"></telerik:RadDropDownList>
                                                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" Display="Dynamic" runat="server" ControlToValidate="ddlMANHOM" ErrorMessage='<img alt="re-check" src="/images/invalid.png"  />'> </asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>Trạng thái</td>
                                                    <td>
                                                        <asp:RadioButtonList runat="server" ID="rblTRANGTHAI" CellPadding="8" RepeatDirection="Horizontal">
                                                            <asp:ListItem Text="Mở" Value="1" Selected="True"></asp:ListItem>
                                                            <asp:ListItem Text="Đóng" Value="0"></asp:ListItem>
                                                        </asp:RadioButtonList>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>Ghi chú</td>
                                                    <td>
                                                        <telerik:RadTextBox runat="server" ID="txtGHICHU" Skin="Telerik" TextMode="MultiLine" Text='<%# Bind("GHICHU")  %>'></telerik:RadTextBox></td>
                                                </tr>
                                                <tr>
                                                    <td></td>
                                                    <td>
                                                        <asp:LinkButton ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Thêm mới" : "Cập nhật" %>'
                                                            runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:LinkButton>&nbsp;
                                <asp:LinkButton ID="btnCancel" Text="Hủy" runat="server" CausesValidation="False"
                                    CommandName="Cancel"></asp:LinkButton></td>
                                                </tr>
                                            </table>
                                        </div>
                                    </FormTemplate>
                                </EditFormSettings>                            
                        </MasterTableView>
                        <ClientSettings>
                            <ClientEvents OnPopUpShowing="PopUpShowing" />
                            <ClientEvents OnRowDblClick="RowDblClick" />
                            <Selecting AllowRowSelect="true" />
                            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                            <Animation AllowColumnReorderAnimation="true" ColumnReorderAnimationDuration="500" />
                        </ClientSettings>
                        <ExportSettings Excel-Format="Biff" Pdf-DefaultFontFamily="Arial" FileName="Mydata" IgnorePaging="false" Excel-AutoFitImages="true" Excel-FileExtension="xls" HideStructureColumns="true"></ExportSettings>
                    </telerik:RadGrid>
                </td>
            </tr>
        </table>
    </div>

    <telerik:RadNotification ID="rnAlert" Width="300" runat="server" ContentScrolling="Auto" Position="TopRight" EnableRoundedCorners="true"
        EnableShadow="true" Skin="Metro" Overlay="true" Animation="Fade" AnimationDuration="1000" Title="Thông báo">
    </telerik:RadNotification>
    
        
</asp:Content>